#ifndef INA226_H
#define INA226_H

#include "gd32f10x_gpio.h"

typedef struct
{
    float voltageVal;    // mV
    float Shunt_voltage; // uV
    float Shunt_Current; // mA
    float powerVal;
    // uint16_t CalibrationVal;
    // uint8_t Current_sign;
} INA226_Data;

#define INA226_ADDR1 0x80

uint16_t INA226_Get_ID(uint8_t addr);
int16_t INA226_Get_BusVoltage(uint8_t addr, INA226_Data *INA226_temp);
int16_t INA226_Get_ShuntCurrent(uint8_t addr, INA226_Data *INA226_temp);
int16_t INA226_Get_ShuntVoltage(uint8_t addr, INA226_Data *INA226_temp);

uint16_t INA226_Get_Power(uint8_t addr, INA226_Data *INA226_temp);


void INA226_Init(void);


extern INA226_Data INA226_data;


#endif // INA226_H
